FROM centos:centos7
MAINTAINER liuchuang@csc-sz.cn

# 设置maven环境变量
ENV MAVEN_HOME=/usr/local/apache-maven-3.6.3
ENV PATH=${MAVEN_HOME}/bin:${PATH}
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64

# 替换官方软件源为国内的
RUN yum install -y wget && \
    mv /etc/yum.repos.d/*.repo /tmp/ && \
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo && \
    yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo && \
    yum install -y docker-ce-18.03.1.ce-1.el7.centos && \
#    wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo && \
    yum install -y java-1.8.0-openjdk-devel && \
    wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz && \
    tar -xf apache-maven-3.6.3-bin.tar.gz -C /usr/local && \
    rm apache-maven-3.6.3-bin.tar.gz && \
    # 下载npm需要git2.x
    yum install -y epel-release && \
    yum install -y https://repo.ius.io/ius-release-el7.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
    yum install -y git

# 将私服10.28.25.211:8082的登录认证添加到镜像
COPY config.json /root/.docker/